<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('FTP内生性调整型参数配置列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">

            <!--<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="ftpAdjustment:info:export">-->
                <!--<i class="fa fa-download"></i> 导出-->
            <!--</a>-->

            <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="ftpAdjustment:info:add">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="ftpAdjustment:info:edit">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="ftpAdjustment:info:remove">
                <i class="fa fa-remove"></i> 删除
            </a>

        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">

    var editFlag = [[${@permission.hasPermi('ftpAdjustment:info:edit')}]];
    var removeFlag = [[${@permission.hasPermi('ftpAdjustment:info:remove')}]];

    //FTP频率类型:repricing_frequency_type重定价频率类型,interest_frequency_type:结息频率类型,repayment_frequency_type:还款频率类型
    var ftpFrequencyType = [[${@dict.getType('ftp_frequency_type')}]];
    //期限类型:1存贷款收益率曲线,2期限流动性溢价-点差2(原始期限)
    var calcuPeriodUnitType = [[${@dict.getType('calcu_period_unit_type')}]];

    var prefix = ctx + "ecard/ftp/adjustment/config";

    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "FTP内生性调整型参数配置",
            columns: [
                {
                    checkbox: true
                },
                {
                    field: 'configId',
                    title: '主键ID',
                    visible: false
                },
                {
                    field: 'frequencyType',
                    title: 'FTP频率类型',
                    formatter: function (value, item, index) {
                        return $.table.selectDictLabel(ftpFrequencyType, item.frequencyType);
                    }
                },
                {
                    field: 'frequencySubType',
                    title: 'FTP频率子类型',
                    formatter: function (value, item, index) {

                        var frequencyTypeVal = item.frequencyType;
                        if(frequencyTypeVal == 'repricing_frequency_type'){
                            var dictTypeVal = [[${@dict.getType('repricing_frequency_type')}]];
                            return $.table.selectDictLabel(dictTypeVal, item.frequencySubType);
                        }else if(frequencyTypeVal == 'interest_frequency_type'){
                            var dictTypeVal = [[${@dict.getType('interest_frequency_type')}]];
                            return $.table.selectDictLabel(dictTypeVal, item.frequencySubType);
                        }
                    }
                },
				{
					field: 'originalDeadlineType',
					title: '原始期限'
				},
				{
					field: 'calcuPeriodUnit',
					title: '周期计算单位类型',
                    formatter: function (value, item, index) {
                        return $.table.selectDictLabel(calcuPeriodUnitType, item.calcuPeriodUnit);
                    }
				},
				{
					field: 'calcuUnderDay',
					title: '下限天数'
				},
				{
					field: 'calcuUpperDay',
					title: '上限天数'
				},
				{
					field: 'adjustmentRate',
					title: '调整值'
				},
				{
					field: 'createBy',
					title: '创建者'
				},
                {
                    field: 'createTime',
                    title: '创建时间'
                },
                {
                    field: 'updateBy',
                    title: '更新者'
                },
                {
                    field: 'updateTime',
                    title: '更新时间'
                },
                {
                    field: 'remark',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.configId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.configId + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>